/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Floors;

import Actors.Actor;
import Actors.HumanControlledBall;
import ElementsProperties.ActorEntranceSensible;
import java.util.Random;

/**
 *
 * @author vf
 */
public class Space extends Floor implements ActorEntranceSensible {

    public Space(){
        Random rand = new Random();
        friction=1;
        floorImage=EnigmaUtils.ImageLoader.loadImage("./images/fl-space.png").getSubimage(rand.nextInt(2)*32,rand.nextInt(3)*32,32,32);
        //floorImage=pooUtils.ImageLoader.loadImage("./images/fl-space.png").getSubimage(0,0,32,32);
    }

    @Override
    public void actorEnters(Actor actor) {
        if (actor instanceof HumanControlledBall)
            ((HumanControlledBall)actor).allowUserControl(false);
    }

    @Override
    public void actorLeaves(Actor actor) {
        if (actor instanceof HumanControlledBall)
            ((HumanControlledBall)actor).allowUserControl(true);
    }

}